Electronic apparatus control method performed through lid angle calculation, electronic apparatus thereof and software product

ABSTRACT

A method is provided for controlling an electronic apparatus on the basis of a value of a lid angle between a first hardware element accommodating a first magnetometer and a second hardware element accommodating a second magnetometer. The method includes acquiring, through the magnetometers, first signals representing an orientation of the hardware elements. A calibration parameter indicative of a condition of calibration of the magnetometers is generated on the basis of the first signals. A reliability value indicative of a condition of reliability of the first signals is generated on the basis of the first signals. A first intermediate value of the lid angle is calculated on the basis of the first signals. A current value of the lid angle is calculated on the basis of the calibration parameter, of the reliability value, and of the first intermediate value, and the electronic apparatus is controlled on the basis of the current value.

BACKGROUND Technical Field

The present disclosure relates to an electronic apparatus control methodperformed via calculation of an angle of lid opening, to an electronicapparatus thereof and to a software product.

Description of the Related Art

As illustrated in FIG. 1 , a portable device 1 of a known type (e.g., anotebook) is typically formed by two functional blocks 2, 4, where thefunctional block 2 accommodates a screen 2 a and the functional block 4accommodates a keypad 4 a and the control unit and memory 4 b, 4 c. Thefunctional blocks 2 and 4 are coupled together by a pivot 6, configuredfor enabling a rotary movement of the functional block 2 with respect tothe functional block 4. An angle α_(LID), known as opening angle or bythe term “lid angle”, is formed between the functional block 2 (i.e., atthe screen 2 a) and the functional block 4 (i.e., at the keypad 4 a).For instance, the angle αLID is formed between respective surfaces ofthe functional block 2 and of the functional block 4. By convention, theangle α_(LID) is equal to 0° when the surface of the functional block 4is parallel to and directly facing the surface of the functional block2; and is equal to 360° when the surface of the functional block 4 isparallel to the surface of the functional block 2 but oriented in theopposite direction.

The measurement of the angle α_(LID) enables, for example, adaptation ormodification of a user interface displayed by the screen 2 a in order toimprove user experience of the portable device 1.

Moreover, it is desirable to measure the angle αLID in portable devicessuch as tablets, foldable smartphones, and portable devices to whichexternal keypads are operatively coupled (for example, integrated in acover of the portable device and connected to the portable device bymeans of a wireless connection) in order to adapt or personalize theuser interface or the configuration of the portable device and makeavailable new possibilities of use thereof.

Known solutions for detecting the angle α_(LID) envisage the use of anaccelerometer mounted on the functional block 2 and of an accelerometermounted on the functional block 4. Said accelerometers supply dataindicating the direction of the force of gravity with respect torespective systems of co-ordinates centered on the accelerometersthemselves, thus making it possible to identify a position of thefunctional block 2 with respect to the functional block 4. However, thissolution, being based exclusively upon the information deriving from theforce gravity, does not make it possible to provide indications usefulfor all the possible orientations and arrangements in space of theportable device 1. In fact, this solution does not enable a reliablemeasurement if the portable device 1 is oriented with the pivot 6parallel to the direction of the force of gravity (i.e., verticalposition, or book-like position, of the portable device 1). Furthermore,the accelerometers are subject to environmental vibrational stimuli thatmay cause the measurement to be imprecise or wrong. In particular, giventhat accelerometers are sensitive to linear accelerations, themeasurement of the angle α_(LID) is unreliable when the portable deviceis moving or else is subjected to external vibrations, for example whena person who is carrying the portable device is walking or is travellingin a means of transport. It is possible to use a filter (e.g., a lowpassfilter) for reducing the effect of the linear accelerations on themeasurement of the angle α_(LID), but this increases the response timein estimation of the angle α_(LID).

The patent document EP3407157 discloses a portable device analogous tothe one illustrated in FIG. 1 , where each functional block furtherincludes a respective gyroscope. Gyroscopes are used in order to improvethe reactivity of the measurement of the angle α_(LID) and to enable,through a data-fusion approach, said measurement to be made even whenthe portable device is rotated in the vertical position.

BRIEF SUMMARY

In various embodiments, the present disclosure provides an electronicapparatus control method performed through lid angle calculation, anelectronic apparatus thereof and a software product that overcome thedrawbacks of the prior art.

According to the present disclosure an electronic apparatus controlmethod performed through lid angle calculation, an electronic apparatusthereof and a software product are provided.

In at least one embodiment, a method is provided for controlling atleast one function of an electronic apparatus as a function of a valueof a lid angle between a first hardware element and a second hardwareelement of the electronic apparatus. The first hardware elementaccommodates a first magnetometer and the second hardware elementaccommodates a second magnetometer and is orientable with respect to thefirst hardware element. The method includes: generating, by the firstmagnetometer and by the second magnetometer, first signals that areindicative of measurements of a magnetic field external to theelectronic apparatus and are indicative of a relative orientation of thefirst hardware element with respect to the second hardware element;acquiring, by a processing unit of the electronic apparatus, the firstsignals; generating, by the processing unit and as a function of thefirst signals, a calibration parameter indicative of a condition ofcalibration of the first and second magnetometers; generating, by theprocessing unit and as a function of the first signals, a reliabilityvalue indicative of a condition of reliability of the first signals;calculating, by the processing unit, a first intermediate value of thelid angle based on the first signals; calculating, by the processingunit, a current value of the lid angle based on the calibrationparameter, the reliability value, and the first intermediate value ofthe lid angle; and controlling the function of the electronic apparatusas a function of the current value of the lid angle.

In at least one embodiment, an electronic apparatus is provided thatincludes a first hardware element, a second hardware element, and aprocessing unit. The first hardware element accommodates a firstmagnetometer. The second hardware element accommodates a secondmagnetometer, orientable with respect to the first hardware element, anddefining a lid angle with the first hardware element. The first andsecond magnetometers are configured for generating first signals thatare measurements of a magnetic field external to the electronicapparatus and are indicative of a relative orientation of the firsthardware element with respect to the second hardware element. Theprocessing unit is configured to: acquire the first signals; generate,as a function of the first signals, a calibration parameter indicativeof a condition of calibration of the first and second magnetometers;generate, as a function of the first signals, a reliability valueindicative of a condition of reliability of the first signals; calculatea first intermediate value of the lid angle based on the first signals;calculate a current value of the lid angle based on the calibrationparameter, of the reliability value, and the first intermediate value ofthe lid angle; and control the function of the electronic apparatus as afunction of the current value of the lid angle.

In at least one embodiment, a non-transitory computer-readable medium isprovided having contents which cause processing circuitry of anelectronic apparatus to perform a method. The electronic apparatusincludes a first hardware element accommodating a first magnetometer,and a second hardware element accommodating a second magnetometer,orientable with respect to the first hardware element, and defining alid angle with the first hardware element, wherein the first and secondmagnetometers are configured for generating first signals that aremeasurements of a magnetic field external to the electronic apparatusand are indicative of a relative orientation of the first hardwareelement with respect to the second hardware element. The methodincludes: acquiring the first signals; generating, as a function of thefirst signals, a calibration parameter indicative of a condition ofcalibration of the first and second magnetometers; generating, as afunction of the first signals, a reliability value indicative of acondition of reliability of the first signals; calculating a firstintermediate value of the lid angle based on the first signals;calculating a current value of the lid angle based on the calibrationparameter, the reliability value, and the first intermediate value ofthe lid angle; and controlling the function of the electronic apparatusas a function of the current value of the lid angle.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

For a better understanding of the present disclosure, a preferredembodiment thereof is now described purely by way of non-limitingexample, with reference to the attached drawings, wherein:

FIG. 1 is a schematic perspective view of a portable device, inparticular a notebook, configured for enabling calculation of an openingangle of the screen with respect to the keypad, according to anembodiment of a known type;

FIG. 2 is a schematic perspective view of a portable device, inparticular a notebook, provided with magnetometers configured forenabling calculation of an opening angle of a screen with respect to akeypad, according to one embodiment;

FIG. 3 is a side view of the portable device of FIG. 2 , in threeoperative conditions alternative to one another;

FIGS. 4A-4B are schematic perspective views of the portable device ofFIG. 2 in respective further operative conditions;

FIG. 5 is a schematic illustration of functional blocks implemented bythe portable device of FIG. 2 , according to an embodiment of thepresent disclosure;

FIG. 5A is a schematic illustration of functional blocks included in oneof the functional blocks of FIG. 5 , according to an embodiment of thepresent disclosure;

FIG. 6 is a schematic perspective view of a portable device, inparticular a notebook, provided with magnetometers and accelerometersconfigured for enabling calculation of an opening angle of a screen withrespect to a keypad, according to a different embodiment;

FIG. 7 is a schematic illustration of functional blocks implemented bythe portable device of FIG. 6 , according to an embodiment of thepresent disclosure;

FIG. 8 is a schematic perspective view of a portable device, inparticular a notebook, provided with magnetometers and gyroscopesconfigured for enabling calculation of an opening angle of a screen withrespect to a keypad, according to a further embodiment; and

FIG. 9 is a schematic illustration of functional blocks implemented bythe portable device of FIG. 8 , according to an embodiment of thepresent disclosure.

DETAILED DESCRIPTION

Elements and steps common to different embodiments of the presentdisclosure are designated hereinafter by the same reference numbers.

With reference to FIG. 2 , according to one aspect of the presentdisclosure, an electronic apparatus (in particular, a portable device)10 is illustrated in a triaxial cartesian reference system XYZ definedby the axes X, Y and Z. In the reference system XYZ, a vector g (oracceleration vector g), which represents the gravity acceleration vectoracting in a direction parallel to the axis Z and having an oppositeorientation with respect thereto, and a vector B, which represents theEarths magnetic field vector (hereinafter, magnetic field B ormagnetic-field vector B), are considered. According to an aspect of thepresent disclosure, the magnetic field B acts in a plane YZ defined bythe axes Y, Z, and in particular forms with the axis Y an inclinationangle δ, for example equal to about 45°, and forms with the accelerationvector a respective angle, for example equal to the angle of inclinationδ.

The device 10 is of a portable type (in particular, a notebook) and ishere represented in an operative condition of open device. The portabledevice 10 includes a lid portion 12 and a base portion 14, mechanicallycoupled to each other by means of a hinge 15, which enables rotation ofthe lid portion 12 with respect to the base portion 14, forming arotation constraint about a rotation axis R (or axis R), in FIG. 2represented by way of example parallel to the axis X. The base portion14 comprises at least one interface device 16 (e.g., a keypad and/or atrackpad), extending at a surface 14 a of the base portion 14. The lidportion 12 comprises a display region 18 (e.g., a screen or monitor),extending at a surface 12 a of the lid portion 12. In an operativecondition of closed device, the surfaces 12 a, 14 a face one another.The lid portion 12 accommodates (e.g., integrates within it) a firstmagnetometer 20 configured for detecting and/or calculating theorientation, along respective sensing axes x₁, y₁, z₁, of the lidportion 12 with respect to the magnetic field B; and the base portion 14accommodates (e.g., integrates within it) a second magnetometer 22,configured for detecting and/or calculating the orientation, alongrespective sensing axes x₂, y₂, z₂, of the base portion 14 with respectto the magnetic field B. The first and second magnetometers 20, 22 areconfigured for generating a first magnetic-field signal (hereinafter,first signal B₁) and, respectively, a second magnetic-field signal(hereinafter, second signal B₂). In general, the first and secondmagnetometers 20, 22 are configured to detect a change of orientation ofthe portable device 10 by means of measurements of the magnetic field B.The first and second magnetometers 20, 22 are, for example,magnetometers obtained with MEMS technology (e.g., MEMS magnetometersbased upon AMR, Anisotropic MagnetoResistance, technology). Inparticular, the first signal B₁ is indicative of the components of themagnetic field B along the sensing axes x₁, y₁, z₁, and the secondsignal B₂ is indicative of the components of the magnetic field B alongthe sensing axes x₂, y₂, z₂.

It is here pointed out that, in the embodiment of the portable device 10here considered, the axis R of the hinge 15 is always parallel to thesensing axes x₁, x₂ in any operative condition (lid portion 12 closed oropen) and for any orientation of the device 10 in the triaxial referencesystem XYZ.

The portable device 10 further comprises a processing unit that includesa microcontroller or control unit 27 and a memory 28, coupled together.The control unit 27 and/or the memory 28 are moreover operativelycoupled to the first and second magnetometers 20, 22 for receivingtherefrom the respective signals B₁, B₂, generated according tooperation in itself known of magnetometers. The signals B₁, B₂ receivedat input from the control unit 27 are processed as better describedhereinafter with reference to FIG. 5 .

In particular, the first and second magnetometers 20, 22 are configuredto detect the variation of a mutual orientation between the lid portion12 and the base portion 14 (for example, due to opening and closing,with respect to the base portion 14, of the lid portion 12 turning aboutthe axis R due to the hinge 15). In this latter case, in particular, thefirst and second magnetometers 20, 22 are used for determining anopening angle α_(LID), supplementary to an angle between the sensingaxis y₁ and the sensing axis y₂ of the respective first and secondmagnetometers 20, 22. The opening angle α_(LID) is therefore correlatedto the angle existing between the surface 12 a of the lid portion 12 andthe surface 14 a of the base portion 14 and is also known as “lidangle”. In use, it is possible to correlate the value of the lid angleα_(LID) with a use mode of the portable device 10 (e.g., a lid angleα_(LID) having a value of about 130° suggests a laptop-use mode, whereasa lid angle α_(LID) having a value of 360° suggests a tablet-use mode.It is therefore possible to adapt the graphic interface represented inthe display region 18 to the type of operating mode, or else adapt otheroperating parameters of the portable device 10, for example enabling atouchscreen function when the tablet-use mode is detected, or vary otherparameters still, such as switching-on/switching-off of the displayregion 18 or of the portable device 10 if the value the lid angleα_(LID) is greater/less than a certain threshold.

FIG. 3 illustrates, in lateral view in the plane YZ, the portable device10 of FIG. 2 , where the lid portion 12 is represented in three possibleoperative conditions S1-S3: lid portion 12 closed on the base portion14, defining a lid angle α_(LID) of zero value (S1); lid portion 12defining a lid angle α_(LID) of 90° with respect to the base portion 14(S2); and lid portion 12 defining a lid angle α_(LID) of 180° withrespect to the base portion 14 (S3).

In the operative conditions S1-S3, the lid angle α_(LID) is the relativeangle between the sensing axis y₁ and the sensing axis y₂ of themagnetometers 20 and 22 (in detail, between the positive semi-axis ofthe axis y₁ and the negative semi-axis of the axis y₂) and, since it hasbeen assumed that said sensing axes y₁, y₂ are parallel to the surfaces12 a, 14 a of the lid portion 12 and the base portion 14, the lid angleα_(LID) is also the relative angle between the surfaces 12 a, 14 a ofthe lid portions 12 and the base portion 14. In other words, the lidangle α_(LID) coincides with the opening angle (or lid angle) of the lidportion 12 with respect to the base portion 14. The same angularquantity may likewise be defined between the axes z₁ and z₂ (in detail,between the positive semi-axis of the axis z₁ and the negative semi-axisof the axis z₂), which are always normal to the surfaces 12 a, 14 a.

Passing from the operative condition S1 to the operative condition S2(or likewise from the operative condition S2 to the operative conditionS3), the first magnetometer 20 detects a variation of the components ofthe magnetic field B along the axes z₁ and y₁, and this makes itpossible to determine the fact that the lid angle α_(LID) increases(whereas the opposite is true, in the passage from the condition S2 tothe condition S1, or from the condition S3 to the condition S2).

It may, in particular, be noted that the magnetic field B is given, inthe operative condition S1, by first values detected on the axes y₁, z₁and, in the operative condition S2, by second values detected on theaxes y₁, z₁, said second values being different from the first values.

In order to calculate a value of the lid angle α_(LID), it is possibleto exploit the projection of the magnetic field B on the respectivethree sensing axes of the first and second magnetometers 20, 22, takinginto consideration the constraints due to the presence of the hinge 15.In this case, a value α_(LID_MAG) of the angle α_(LID) calculated viathe magnetometers 20, 22 is obtained by applying the followingexpression:

$\begin{matrix}{\alpha_{{LID}\_{MAG}} = {{{arc}\tan 2( \frac{{G{z_{2} \cdot {Gy}_{1}}} - {G{y_{2} \cdot {Gz}_{1}}}}{{G{z_{2} \cdot {Gz}_{1}}} + {G{y_{2} \cdot {Gy}_{1}}}} )} + \pi}} & (1)\end{matrix}$

where arctan 2 is the known trigonometric function, Gz₁ is the componentof the magnetic field B detected by the first magnetometer 20 along thesensing axis z₁, Gy₁ is the component of the magnetic field B detectedby the first magnetometer 20 along the sensing axis y₁, Gz₂ is thecomponent of the magnetic field B detected by the second magnetometer 22along the sensing axis z₂, and Gy₂ is the component of the magneticfield B detected by the second magnetometer 22 along the sensing axisy₂. As represented by Eq. (1), the value α_(LID_MAG) measured via themagnetometers 20, 22 represents a relative orientation (i.e., anorientation that is not absolute in space) between the lid portion 12and the base portion 14.

FIG. 4A shows a mode of use of the portable device 10 where the portabledevice 10 is oriented with the axis R parallel to the magnetic-fieldvector B. In this case, passage into the operative conditions S1-S2-S3does not cause a variation of the component of magnetic field B alongthe sensing axes z₁, z₂, and y₁, y₂ of the first and secondmagnetometers 20, 22, since the components of the magnetic field B alongthe axes referred to are always zero or substantially zero (i.e., thevalues Gz₁, Gz₂, Gy₁, Gy₂ of Eq. (1) are approximately equal to zero).Consequently, in this situation the value α_(LID_MAG) cannot becalculated accurately. What has been described with reference to FIG. 4Amay be applied, in a way in itself obvious, also to the operativecondition (not illustrated) where the portable device 10 is orientedwith the axis R parallel to the magnetic-field vector B, but rotatedthrough 180° with respect to the orientation shown in FIG. 4A.

With reference to FIG. 4B an intermediate situation of orientation isshown, where the axis R forms with the magnetic-field vector B areliability angle φ other than 0° and smaller than or equal to 90°.These intermediate situations of orientation lead to measurements of thevalue α_(LID_MAG) that are all the more erroneous, the more closely theyapproach the condition of FIG. 4A (axis R parallel to the magnetic-fieldvector B), i.e., the closer the reliability angle φ is to 0°.

In operative conditions where the sensing axes x₁ and x₂ are parallel tothe magnetic field B and the sensing axes y₁ and y₂ are perpendicular tothe magnetic field B (FIG. 4A), the components Gx₁ and Gx₂ have amaximum value, and the components Gy₁ and Gy₂ have a minimum value;instead, in operative conditions where the sensing axes x₁ and x₂ areperpendicular to the magnetic field B and the sensing axes y₁ and y₂ areparallel to the magnetic field B, the components Gx₁ and Gx₂ have aminimum value and the components Gy₁ and Gy₂ have a maximum value (theminimum and maximum values depend upon the type of inertial sensor usedand are defined by the manufacturer).

The reliability of the calculation of the value α_(LID_MAG) is thereforecorrelated to a first reliability angle φ₁, which represents themeasurement of the reliability angle (p made via the magnetometers 20,22.

According to an aspect of the present disclosure, a first angle φ_(a) iscalculated via the first magnetometer 20 according to the followingexpression:

$\begin{matrix}{\varphi_{a} = {\tan^{- 1}\frac{\sqrt{{Gy_{1}^{2}} + {Gz_{1}^{2}}}}{❘{Gx}_{1}❘}({rad})}} & (2)\end{matrix}$

The first angle φ_(a) therefore varies between 0° and 90°. Likewise, asecond angle φ_(b) is calculated via the second magnetometer 22.

The first reliability angle φ₁ is correlated to the first angle φ_(a)and/or the second angle φ_(b). According to one aspect of the presentdisclosure, the first reliability angle φ₁ is equal to the first angleφ_(a) or to the second angle φ_(b); according to a different aspect ofthe present disclosure, the first reliability angle φ₁ is equal to anaverage (alternatively, a weighted average) of the first and secondangles φ_(a), φ_(b).

If the first reliability angle φ₁ is greater than a threshold angleφ_(th), the measurement of the value α_(LID_MAG) is considered reliable;and if the first reliability angle φ₁ is smaller than or equal to thethreshold angle φ_(th), the measurement of the value α_(LID_MAG) isconsidered unreliable. For instance, the threshold angle φ_(th) is equalto approximately 20°. Alternatively, the measurement of the valueα_(LID_MAG) is considered reliable only if both of the angles φ_(a),φ_(b) are greater than the threshold angle φ_(th).

According to an aspect of the present disclosure, the control unit 27,with the possible support of the memory 28, is configured for executingthe operations illustrated in FIG. 5 and described hereinafter. FIG. 5is a schematic illustration of functional blocks implemented, viasoftware and in an iterative way, by the control unit 27 and memory 28.

It is evident that the functional blocks of FIG. 5 can be implemented inhardware in a way in itself evident to the person skilled in the art.

In particular, at each instant (or iteration) t (e.g., 0<t<N, with N>1),the control unit 27 acquires the first signal B₁ and the second signalB₂ via the first magnetometer 20 and the second magnetometer 22,respectively. The first signal B₁ represents (e.g., comprises) thecomponents Gx₁, Gy₁, and Gz₁ (in particular, Gx₁(t), Gy₁(t), andGz₁(t)), and the second signal B₂ represents (e.g., comprises) thecomponents Gx₂, Gy₂, and Gz₂ (in particular, Gx₂(t), Gy₂(t), andGz₂(t)).

A calibration block 49 receives at input the components Gx₁(t), Gy₁(t),Gz₁(t), Gx₂(t), Gy₂(t), and Gz₂(t), and returns at output a firstcalibration value J₁, indicative of the possible presence of magneticinterference and magnetic distortion of the magnetometers 20, 22. Ingeneral, the first calibration value J₁ is correlated to a calibrationreliability of the magnetometers 20, 22. The first calibration value J₁may be a binary value in the case of single threshold(reliable/unreliable calibration, for example J₁=1 and, respectively,J₁=0), or else a value proportional to a degree of reliability ofcalibration detected.

The calibration block 49 is illustrated in detail in FIG. 5A, withreference to the case where the first calibration value J₁ assumes abinary value.

In a block 49 a, the first calibration value J₁ is initialised at 0(unreliable calibration). In addition, in block 49 a the control unit 27acquires, via the magnetometers 20, 22, calibration data D₁ (e.g., equalto the signals B₁, B₂, or else comprising a result of processing of thesignals B₁, B₂ acquired in a first calibration interval). Furthermore,at the first iteration (t=1) there is performed, as better describedhereinafter, a calibration in order to generate calibration parametersP_(cal) correlated to the electromagnetic conditions to which themagnetometers 20, 22 are subjected. In particular, the calibrationparameters P_(cal) include a soft iron matrix (SI) and a hard-ironvector (HI), and are calculated in a way in itself known. Moreover, bothat the first iteration (t=1) and at the subsequent iterations (t>1),calibrated data D₂ are generated on the basis of the calibration data D₁and of the calibration parameters P_(cal). In detail, the calibrateddata D₂ are the result of processing of the calibration data D₁performed via the calibration parameters P_(cal).

In a block 49 b that follows block 49 a, a condition regardingcalibration of the magnetometers 20, 22 is evaluated. In particular, itis determined whether it is necessary or desired to carry out acalibration of the magnetometers 20, 22. This calibration enablescompensation of electromagnetic effects to which the magnetometers 20,22 are subjected, due to factors such as variations in time ofmagnetization of components arranged in the proximity to themagnetometers themselves or the presence of ferromagnetic material. Indetail, in block 49 b the control unit 27 compares the calibrated dataD₂ with an expected range (e.g., defined between approximately 0.25gauss and approximately 0.75 gauss), correlated to an expected intensityof the Earths magnetic field. If a Euclidean norm |D₂| of the calibrateddata D₂ satisfies, at the current iteration t, a first relation (e.g.,it is comprised in said expected range and, for instance, is comprisedbetween approximately 0.25 gauss and approximately 0.75 gauss, extremesincluded) the condition on the calibration of the magnetometers 20, 22yields a negative result, and it is not necessary to carry out a newcalibration; if the Euclidean norm |D₂| of the calibrated data D₂ doesnot satisfy, at the current iteration t, said first relation (e.g., itis not comprised in the expected range, and for instance it is less than0.25 gauss or greater than 0.75 gauss) the condition on the calibrationof the magnetometers 20, 22 yields a positive result, and it isnecessary to carry out the new calibration.

If it is necessary to carry out calibration of the magnetometers 20, 22(output “YES” from block 49 b), said calibration is carried out,according to known techniques (e.g., via sphere-fitting orellipsoid-fitting algorithms), in a block 49 c, which follows block 49 bin the case of output “YES”. In detail, the portable device 10 isrotated freely in three-dimensional space by the operator, andsimultaneously the control unit 27 acquires the signals B₁, B₂ during asecond calibration interval, via the magnetometers 20, 22. The signalsB₁, B₂ acquired during the second calibration interval are processedaccording to known techniques for generating new calibration parametersP_(cal), which replace the previous calibration parameters P_(cal).During the second calibration interval, the first calibration value J₁is set at 0.

In a block 49 d following block 49 c, the first calibration value J₁ isset at 1, to indicate that the calibration is reliable.

If it is not necessary to carry out calibration of the magnetometers 20,22 (output “NO” from block 49 b), a condition regarding magneticinterference (e.g., interference caused by electromagnetic sources setin the proximity of the portable device 10) is evaluated. In particular,in a block 49 e following block 49 b in the case of output “NO”, it isdetermined whether the magnetometers 20, 22 are subjected to magneticinterference. In particular, the calibrated data D₂ are evaluated intime to determine whether the magnetometers 20, 22 are subjected tomagnetic interference. In greater detail, if the Euclidean norm |D₂| ofthe calibrated data D₂ satisfies a second relation (e.g., it does notvary significantly in time), the check on the condition regardingmagnetic interference yields a negative result, and magneticinterference is not present; if the Euclidean norm |D₂| of thecalibrated data D₂ does not satisfy the second relation (e.g., it variessignificantly in time), the check on the condition regarding magneticinterference yields a positive result, and magnetic interference ispresent. For instance, the second relation is satisfied if the varianceof the Euclidean norm |D₂| of the calibrated data D₂ is less than agiven threshold.

If no magnetic interference is present (output “NO” from block 49 e),the procedure described of block 49 d is again carried out, and then thefirst calibration value J₁ is set at 1 to indicate that the calibrationis reliable.

If magnetic interference is present (output “YES” from block 49 e), thefirst calibration value J₁ is set at 0 in a block 49 f following block49 e in the case of output “YES”, to indicate that the calibration isunreliable.

At output from the calibration block 49, there is therefore the firstcalibration value J₁, which, if it is equal to 0, indicates that thecalibration is unreliable (and therefore also the measurement of thevalue α_(LID) MAG will not be reliable), whereas, if it is equal to 1,indicates that the calibration is reliable (and therefore themeasurement of the value α_(LID_MAG) could be reliable, as describedhereinafter).

With reference to FIG. 5 , in a typical condition of use of the portabledevice 10, the base portion 14 lies in a horizontal plane XY, resting onan ideally flat surface. Since the magnetometers 20, 22 are in a fixedposition and the orientation of the respective sensing axes is known, itis possible to calculate, via the control unit 27, the value α_(LID_MAG)(in particular, α_(LID_MAG)(0) of the lid angle α_(LID) (in particular,α_(LID)(t)) as expressed by Eq. (1). In detail, a first calculationblock 50 implements Eq. (1), receiving at input the components Gx₁(t),Gy₁(t), Gz₁(t), Gx₂(t), Gy₂(t), and Gz₂(t), and returning at output thevalue α_(LID_MAG)(t) of the lid angle α_(LID)(t).

A first reliability block 52 receives at input, from the first andsecond magnetometers 20, 22, the components Gx₁(t), Gy₁(t), Gz₁(t),Gx₂(t), Gy₂(t), and Gz₂(t) and implements Eq. (2) for calculating thefirst reliability angle φ₁ (in particular, y₁(t)), as describedpreviously. The first reliability angle φ₁(t) is then compared, asdiscussed previously, with the threshold angle φ_(th) to establish thereliability of the calculation of the value α_(LID_MAG)(t). The firstreliability block 52 therefore generates at output a first reliabilityvalue K₁, which may be a binary value in the case of single threshold(reliable/unreliable, for example K₁=1 and, respectively, K₁=0), or elsea value proportional to a degree of reliability detected. In this lattercase, it is possible to envisage a plurality of thresholds of comparisonof the first reliability angle φ₁(t), so that the first reliabilityvalue K₁ will vary according to a staircase function, associating adifferent first reliability value K₁ when each threshold provided isexceeded. The first reliability value K₁ will therefore vary between aminimum value and a maximum value the more the components Gx₁(t) andGx₂(t) decrease and the components Gy₁(t), Gy₂(t), Gz₁(t) and Gz₂(t)increase; the minimum reliability value K₁ may be the zero value,whereas the maximum reliability value K₁ is chosen between 0 (excluded)and 1 according to the considerations that will be made in what followswith reference to block 56. Moreover, the first reliability value K₁ iscorrelated to the first calibration value J₁. In detail, if the firstcalibration value J₁ is equal to 0 (unreliable calibration), the firstreliability value K₁ is set at 0 (measurement of the valueα_(LID_MAG)(t) unreliable); if the first calibration value J₁ is equalto 1 (reliable calibration), the first reliability value K₁ isdetermined on the basis of what has been described previously. Likewise,if the first calibration value J₁ assumes said proportional values, thefirst reliability value K₁ is determined on the basis of what has beendescribed previously and moreover is weighted as a function of the firstcalibration value J₁ in a known way (e.g., K₁=K₁·J₁).

A determination block 53 receives at input the first reliability valueK₁ from the first reliability block 52 and the value α_(LID_MAG)(t) fromthe first calculation block 50, and determines the lid angle α_(LID)(t).

According to one embodiment, where the first reliability value K₁assumes a binary value, the lid angle α_(LID)(t) is equal to the valueα_(LID_MAG)(t) if K₁=1 (i.e., if the measurement of the valueα_(LID_MAG)(t) is reliable), and is independent of the valueα_(LID_MAG)(t) if K₁=0 (i.e., if the measurement of the valueα_(LID_MAG)(t) is unreliable). For instance, if K₁=0 the lid angleα_(LID)(t) is not updated and therefore is equal to α_(LID_MAG)(t−1). Inthe case where at the first iteration (t=1) the measurement of the valueα_(LID_MAG)(t) is not reliable, the lid angle α_(LID)(t) is set equal toa predefined value; for example, it is set equal to 0°.

According to a different embodiment, where the first reliability valueK₁ assumes said proportional values, the lid angle α_(LID)(t) iscalculated, on the basis of the value α_(LID_MAG)(t) and as a functionof the first reliability value K₁, via a dynamic lowpass filter or acomplementary filter. For instance, the lid angle α_(LID)(t) iscalculated via the following expression:

α_(LID)(t)=(1−K ₁′)·α_(LID)(t−1)+K ₁′·α_(LID_MAG)(t) (rad)  (3)

where K₁=n K₁, with n=1 according to one aspect of the presentdisclosure or else, according to a different aspect of the presentdisclosure, 0<n=n_(max)(e.g., n_(max)=0.1) in order to reduce the noiseof the magnetometers 20, 22. In the case where at the first iteration(t=1) the measurement of the value α_(LID_MAG)(t) is not reliable, thelid angle α_(LID)(t) is set equal to a predefined value; for example, itis set equal to 0°. In addition, at the first iteration (t=1), since thevalue α_(LID)(t−1) corresponding to the previous instant t−1 does notexist, α_(LID)(t) is, for example set at a value equal toα_(LID_MAG)(t), or else at a predefined value.

Alternatively, calculation of the lid angle α_(LID) may take intoaccount directly and explicitly the first calibration value J₁. In thiscase, the first reliability value K₁ is not correlated to the firstcalibration value J₁ and, for example, Eq. (3) implemented in thedetermination block 53 is replaced by the following expression:

α_(LID)(t)=(1−J ₁ ·K ₁)·α_(LID)(t−1)+J ₁ ·K ₁·α_(LID_MAG)(t)(rad)  (3bis)

FIG. 6 shows the portable device 10 in a different embodiment, analogousto the one illustrated in FIG. 2 .

In particular, with reference to the embodiment of FIG. 6 , the lidportion 12 moreover accommodates (e.g., integrates within it) a firstaccelerometer 30, configured for detecting and/or calculating values ofacceleration of the lid portion 12 along respective sensing axes x₃, y₃,z₃, parallel to the sensing axes x₁, y₁, z₁, respectively, of the firstmagnetometer 20; and the base portion 14 moreover accommodates (e.g.,integrates within it) a second accelerometer 32, configured fordetecting and/or calculating values of acceleration of the base portion14 along respective sensing axes x₄, y₄, z₄, parallel to the sensingaxes x₂, y₂, z₂, respectively, of the second magnetometer 22. It is herepointed out that, in the embodiment here considered, the axis R of thehinge 15 is always parallel to the sensing axes x₁, x₂, x₃, x₄ in anyoperative condition (lid portion 12 closed or open) and for anyorientation of the device 10 in the triaxial reference system XYZ. Thefirst and second accelerometers 30, 32 are operatively coupled to thecontrol unit 27 and/or to the memory 28 and are configured to detect amovement and/or change of orientation of the portable device 10 bymeasuring accelerations. The first and second accelerometers 30, 32 are,for example, accelerometers obtained with MEMS technology.

In particular, as has been described with reference to FIG. 3 , in thepassage from the operative condition S1 to the operative condition S2(or likewise from the operative condition S2 to the operative conditionS3), the first accelerometer 30 detects a variation of the component ofthe acceleration of gravity g along the axes z₃ and y₃ and determinesthat the angle α_(LID) has increased (the reverse applies in the passagefrom the condition S2 to the condition S1, or from the condition S3 tothe condition S2).

It is to be noted, in particular, that the acceleration of gravity g isgiven, in the operative condition S1, exclusively by the value detectedalong the axis z₃ and, in the operative condition S2, exclusively by thevalue detected along the axis y₃. In an intermediate condition, forexample when the angle α_(LID) is equal to 45°, both of the axes y₃ andz₃ yield the same value of acceleration.

In the operative condition S1, the sensing axis z₃ is parallel to thegravity acceleration vector g (the projection of the gravityacceleration vector g on the axis z₃ is maximum), in the operativecondition S2, the sensing axis z₃ is orthogonal to the gravityacceleration vector g (the projection of the gravity acceleration vectorg on the axis z₃ is minimum), and in the operative condition S3, thesensing axis z₃ is parallel to the gravity acceleration vector g, buthas an opposite orientation as compared to the operative condition S1(the projection of the gravity acceleration vector g on the axis z₃ ismaximum, but with opposite sign).

In order to calculate a value of the angle α_(LID), it is possible toexploit the projection of the gravity acceleration vector g on therespective three sensing axes of the first and second accelerometers 30,32, taking into consideration the constraints due to the presence of thehinge 15. In this case, a value α_(LID_ACC) of the angle α_(LID) can becalculated as:

$\begin{matrix}{ {{\alpha_{{LID}\_{ACC}} -} = {{arc}\tan 2\{ \frac{{{Az}_{4} \cdot {Ay}_{3}} - {{Ay}_{4} \cdot {Az}_{3}}}{{{Az}_{4} \cdot {Az}_{3}} + {{Ay}_{4} \cdot {Ay}_{3}}} }} ) + {\pi({rad})}} & (4)\end{matrix}$

where arctan 2 is the known trigonometric function, Az₃ is the value ofacceleration detected by the first accelerometer 30 along the sensingaxis z₃, Ay₃ is the value of acceleration detected by the firstaccelerometer 30 along the sensing axis y₃, Az₄ is the value ofacceleration detected by the second accelerometer 32 along the sensingaxis z₄, and Ay₄ is the value of acceleration detected by the secondaccelerometer 32 along the sensing axis y₄. Eq. (4) shows how the valueα_(LID_ACC) measured via the accelerometers 30, 32 represents a relativeorientation (i.e., an orientation that is not absolute in space) betweenthe lid portion 12 and the base portion 14.

When the portable device 10 is oriented with the axis R parallel to theaxis Z, i.e., parallel to the gravity vector g (portable device 10 openlike a book), passage into the operative conditions S1-S2-S3 does notcause a variation of the component of acceleration along the sensingaxes z₃, z₄, y₃, and y₄ of the first and second accelerometers 30, 32since the component of the acceleration of gravity g along the axesindicated is always zero or substantially zero (the values Az₃, Az₄,Ay₃, and Ay₄ of Eq. (4) are approximately equal to zero).

Situations of intermediate orientation, where the axis R forms an angleof less than 90°, but greater than 0°, with the axis Z, lead tomeasurements of the value α_(LID_ACC) that are all the more erroneousthe more closely they approach the condition where the axis R isparallel to the axis Z.

What has been described previously may be applied, in a way in itselfobvious, also to the operative condition where the portable device 10 isoriented with the axis R parallel to the axis Z, but rotated through180° with respect to what has been discussed previously.

In particular, the reliability of the calculation of the valueα_(LID_ACC) is therefore correlated to a second reliability angle φ₂,which represents the measurement of the reliability angle (p made viathe accelerometers 30, 32.

According to one aspect of the present disclosure, a third angle (pc iscalculated via the first accelerometer 30 according to the followingexpression:

$\begin{matrix}{\varphi_{c} = {\tan^{- 1}\frac{\sqrt{{Ay}_{s}^{2} + {Az}_{s}^{2}}}{❘{Ax}_{s}❘}}} & (5)\end{matrix}$

where Ax₃ is the value of acceleration detected by the firstaccelerometer 30 along the sensing axis x₃. The third angle (pctherefore varies between 0° and 90°. Likewise, a fourth angle spa iscalculated via the second accelerometer 32.

The second reliability angle φ₂ is correlated to the third angle (pcand/or to the fourth angle φ_(a), as has been described previously withreference to the first reliability angle φ₁.

If the second reliability angle φ₂ is greater than a further thresholdangle (e.g., equal to the threshold angle φ_(th)), the measurement ofthe value α_(LID_ACC) is considered reliable, and if the secondreliability angle φ₂ is smaller than or equal to said further thresholdangle, the measurement of the value α_(LID_ACC) is consideredunreliable. Alternatively, the measurement of the value α_(LID_ACC) isconsidered reliable only if both of the angles φ_(c), φ_(d) are greaterthan the further threshold angle.

In order to prevent the measurements of the angle α_(LID) frompresenting an increasingly lower reliability the more closely theyapproach the condition of FIG. 4A (axis R parallel to the magnetic fieldB), as described for the portable device 10 of FIG. 2 , in theembodiment of FIG. 6 the measurements obtained by the first and secondaccelerometers 30, 32 are fused with the measurements obtained by thefirst and second magnetometers 20, 22; for example, the measurementsobtained from the first and second accelerometers 30, 32 are moreweighted (and, accordingly, the measurements obtained from the first andsecond magnetometers 20, 22 are less weighted), the smaller the anglebetween the axis R and the magnetic field B (i.e., the more closely thecondition of FIG. 4A is approached). In this way, the reliability of themeasurement of the angle α_(LID) is guaranteed both when the axis R isparallel to the magnetic field B and when it is parallel to theacceleration of gravity g (i.e., parallel to the axis Z). Since themagnetic field B and the acceleration of gravity g are mutuallyorthogonal, the measurement of the angle α_(LID), made as described morefully hereinafter, is always reliable.

According to one aspect of the present disclosure, the control unit 27,with the optional support of the memory 28, is moreover operativelyconnected to the accelerometers 30, 32 and is configured for executingthe operations illustrated in FIG. 7 and described hereinafter. FIG. 7is a schematic illustration of functional blocks analogous to the onesillustrated in FIG. 5 .

In particular, moreover, a second calculation block 55 is represented inFIG. 7 and configured for receiving at input the values of acceleration(comprising, in detail, the components Ay₃, Az₃, Ay₄ and Azo) detectedby the first and second accelerometers 30, 32, and calculating the valueα_(LID_ACC) of the lid angle α_(LID) on the basis of Eq. (4).

Optionally, a second reliability block 54 is moreover present, receivingat input, from the first and second accelerometers 30, 32, thecomponents Ax₃(t), Ay₃(t), Az₃(t), Ax₄(t), Ay₄(t), and Az₄(t), andimplementing Eq. (5) for calculating the second reliability angle φ₂ (inparticular, φ₂(t)). As has been described previously with reference tothe first reliability angle φ₁, the second reliability angle φ₂(t) isthen compared with the further threshold angle to establish thereliability of the calculation of the value α_(LID_ACC)(t). The secondreliability block 54 therefore generates at output a second reliabilityvalue K₂ analogous to the first reliability value K₁.

A first fusion block 56, replacing in FIG. 7 the determination block 53of FIG. 5 , has the function of generating a final value, deemedreliable, of the lid angle α_(LID) on the basis of the first reliabilityvalue K₁ and/or the second reliability value K₂. The first fusion block56 receives at input the first reliability value K₁ and/or the secondreliability value K₂ and both of the values α_(LID_MAG), α_(LID_ACC)calculated, respectively, according to Eq. (1) (i.e., using just thesignals of the magnetometers 20, 22) and according to Eq. (4) (i.e.,using just the signals of the accelerometers 30, 32).

According to one embodiment, the first fusion block 56 implements alowpass filter that enables filtering of the noise of the magnetometers20, 22 and the linear accelerations of the accelerometers 30, 32, saidfilter being defined by the following expression:

α_(LID)(t)≤K _(LP)·α_(LID_ACC_MAG)(t)+(1−K _(LP))·α_(LID)(t−1)(rad)  (6)

where K_(LP) is a coefficient comprised between 0 and 1 (e.g., it isequal to 0.1) and α_(LID_ACC_MAG)(t)α_(LID_ACC_MAG)(t) is a value thusdefined:

-   -   if K₁=0 and K₂≠0 (i.e., magnetometers 20, 22 unreliable, and        accelerometers 30, 32 reliable), then

α_(LID_ACC_MAG)(t)=α_(LID_ACC)(t)α_(LID_ACC_MAG)(t)

-   -   if K₁≠0 and K₂=0 (i.e., accelerometers 30, 32 unreliable, and        magnetometers 20, 22 reliable), then

α_(LID_ACC_MAG)(t)=α_(LID_MAG)(t)_(α) _(LID_ACC_MAG) _((t)=α) _(LID_MAG)_((t))

if K₁≠0 and K₂≠0 (i.e., accelerometers 30, 32 and magnetometers 20, 22reliable), then

${\alpha_{{{LID}\_{ACC}}{\_{MAG}}}(t)} = \frac{{K_{1} \cdot {\alpha_{{LID}\_{MAG}}(t)}} + {K_{2}{\alpha_{{LID}\_{ACC}}(t)}}}{K_{1} + K_{2}}$

i.e., the value α_(LID_ACC_MAG)(t) is a weighted average of the valuesα_(LID_MAG)(t) and α_(LID_ACC)(t), where the weights are the reliabilityparameters K₁, K₂.

Furthermore, if K₁=0 and K₂=0 (i.e., accelerometers 30, 32, andmagnetometers 20, 22 unreliable), the coefficient K_(LP) is set at 0 insuch a way that the estimate of the lid angle α_(LID)(t) is not updated,and therefore α_(LID)(t)=α_(LID)(t−1).

Moreover, optionally a further calibration block, of a type in itselfknown, analogous to the calibration block 49 and not illustrated,receives at input the components Ax₃(t), Ay₃(t), Az₃(t), Ax₄(t), Ay₄(t),and Az₄(t), verifies whether said components are calibrated and returnsat output calibrated components (said components at output being equalto the components at input if the components at input are calibrated,and being different from the components at input if the components atinput are not calibrated).

According to a different embodiment, illustrated in FIG. 8 and analogousto the one shown in FIG. 2 , the lid portion 12 moreover accommodates(e.g., integrates within it) a first gyroscope 40, configured fordetecting and/or calculating an orientation and rotation of the lidportion 12 along, and about, sensing axes l₁, m₁, n₁ that are parallel,respectively, to the sensing axes x₁, y₁, z₁ of the first magnetometer20; and the base portion 14 moreover accommodates (e.g., integrateswithin it) a second gyroscope 42, configured for detecting and/orcalculating an orientation and rotation of the base portion 14 along,and about, sensing axes l₂, m₂, n₂ that are parallel, respectively, tothe sensing axes x₂, y₂, z₂ of the second magnetometer 22. It is herepointed out that, in the embodiment here considered, the axis R of thehinge 15 is always parallel to the sensing axes x₁, x₂, l₁, l₂ in anyoperative condition (lid portion 12 closed or open) and for anyorientation of the device 10 in the triaxial reference system XYZ. Thefirst and second gyroscopes 40, 42 are operatively coupled to thecontrol unit 27 and/or to the memory 28 and are configured to detect amovement of the portable device 10 by measuring angular velocities. Thefirst and second gyroscopes 40, 42 are, for example, gyroscopes obtainedwith MEMS technology.

In order to prevent the measurements of the angle α_(LID) frompresenting an increasingly lower reliability, the closer they approachthe condition of FIG. 4A (axis R parallel to the magnetic field B), asdescribed for the portable device 10 of FIG. 2 , in the embodiment ofFIG. 8 the measurements obtained from the first and second gyroscopes40, 42 are fused with the measurements obtained from the first andsecond magnetometers 20, 22; for example, the measurements obtained fromthe first and second gyroscopes 40, 42 are more weighted (and,accordingly, the measurements obtained from the first and secondmagnetometers 20, 22 are less weighted), the more the angle between theaxis R and the magnetic field B decreases (i.e., the more closely thecondition of FIG. 4A is approached). In this way, the reliability of themeasurement of the angle α_(LID) is guaranteed even when the axis R isparallel to the magnetic field B.

The fusion of the measurements of the magnetometers 20, 22 with those ofthe gyroscopes 40, 42 is not carried out occasionally: as betterdescribed hereinafter, according to one aspect of the presentdisclosure, a complementary filter is used (but it is also possible touse other types of filtering, e.g., Kalman filtering), and themagnetometric component is rejected or attenuated, the more the anglebetween the axis R and the magnetic field B decreases. The magnetometriccomponent specifically has the function of correcting the drift of theangle calculated by the gyroscopes 40, 42.

The gyroscopic contribution obtained by means of the measurements of thefirst and second gyroscopes 40, 42 acquired at the current instant t isgiven by

Δ_(α)=(ω_(x2)−ω_(x1))·dt (rad)  (7)

where w_(x1) is the angular velocity measured by the first gyroscope 40with respect to the sensing axis l₁, ω_(x2) is the angular velocitymeasured by the second gyroscope 42 with respect to the sensing axis l₂.The value dt represents the time that has elapsed between the instantt−1 and the instant t (data-sampling or data-acquisition time of thegyroscopes 40, 42, which in turn may depend upon the updating time ofthe system, for example comprised between 25 Hz and 200 Hz). Forinstance, if sampling of the output of the gyroscopes 40, 42 occurs at100 Hz, the parameter dt is equal to 0.01 s.

According to one aspect of the present disclosure, the control unit 27,with the possible support of the memory 28, is moreover operativelyconnected to the gyroscopes 40, 42 and is configured for executing theoperations illustrated in FIG. 9 and described hereinafter. FIG. 9 is aschematic illustration of functional blocks analogous to the onesrepresented in FIG. 5 .

In particular, FIG. 9 further comprises a third calculation block 58configured for receiving at input the values of angular velocity ω_(x1),ω_(x2) detected by the first and second gyroscopes 40, 42, andcalculating a value α_(LID_GYR) of the lid angle α_(LID) on the basis ofEq. (8) referred to in what follows.

For this purpose, the third calculation block 58 includes a sub-block 58a configured for calculating (at the instant t) the variation Aa of thevalue α_(LID)(t) of the lid angle α_(LID) with respect to the valueα_(LID)(t−1) previously measured (at the previous instant t−1),according to Eq. (7) provided above.

In addition, the third calculation block 58 includes a further sub-block58 b, configured for receiving the variation value Aa and the last valueα_(LID)(t−1) of the lid angle α_(LID) calculated and deemed reliable(e.g., generated at output from a second fusion block 60, describedhereinafter), and updating in a recursive way said last valueα_(LID)(t−1) of the lid angle α_(LID) using the variation value Aa. Thesub-block 58 b therefore implements the following expression:

α_(LID_GYR)(t)=Δ_(α)+α_(LID)(t−1) (rad)  (8)

The second fusion block 60 has the function of generating a final value,deemed reliable, of the lid angle α_(LID) on the basis of the firstreliability value K₁ calculated by the first reliability block 52. Thesecond fusion block 60 receives at input both of the valuesα_(LID_MAG)(t), α_(LID_GYR)(t) calculated according to Eq. (1) (i.e.,using just the signals of the magnetometers 20, 22) and, respectively,according to Eq. (8) (i.e., by updating the value α_(LID)(t−1) with thevariation Aa obtained via measurements supplied by the gyroscopes 40,42).

According to one embodiment, the second fusion block 60 implements acomplementary filter between the values α_(LID_MAG)(t) andα_(LID_GYR)(t), according to the following expression:

α_(LID)(t)=K ₁′·α_(LID_MAG)(t)+(1−K ₁′)·((ω_(x2)−ω_(x1))·dt+α_(LID)(t−1))

α_(LID)(t)=K ₁′·α_(LID_MAG)(t)+(1−K ₁′)·((ω_(x2)−ω_(x1))·dt+α_(LID)(t−1))  (9)

where K₁=n K₁, with n=1 according to one aspect of the presentdisclosure or else, according to a different aspect of the presentdisclosure, 0<n≤n_(max) (e.g., n_(max)=0.1) in order to reduce the noiseof the magnetometers 20, 22.

In particular, since the value α_(LID)(t−1) does not exist at the firstiteration (t=1), for example α_(LID)(t) is set at a value equal toα_(LID_MAG)(t) or else at a predefined value (e.g., 0°).

From an examination of the characteristics of the disclosure providedaccording to the present disclosure the advantages that it affordsemerge clearly.

In particular, the operations of calculation of the lid angle α_(LID)between the lid portion 12 and the base portion 14 do not require thecalculation of the absolute orientation of the lid portion 12 and of thebase portion 14, unlike the prior art where measurements are made ofabsolute orientation in space of respective functional blocks, withrespect to which it is desired to calculate a lid angle.

In particular, the presence of the magnetometers 20, 22 enablesreduction of the overall cost of the portable device 10. In addition,the magnetometers 20, 22 are immune from effects due to linearaccelerations and drift in time. The magnetometers 20, 22 guarantee areliable measurement when the portable device 10 is open like a book(i.e., when the axis R is parallel to the acceleration of gravity g).

Furthermore, use of the first reliability value K₁, associated, as hasbeen said, to an evaluation of reliability of the measurements obtainedvia the magnetometers 20, 22, makes the methodology of the presentdisclosure adaptive as a function of various operative conditions and ofthe service life of the magnetometers themselves.

Real-time calibration of the magnetometers 20, 22 prevents magneticinterference (block 49 e) and magnetic distortion (block 49 b) fromaffecting the measurement of the lid angle α_(LID).

With reference to the embodiment of FIG. 6 , the simultaneousmeasurement made by the magnetometers 20, 22 and the accelerometers 30,32 makes it possible, in addition to the advantages already listed withreference to FIG. 2 , to guarantee, via the accelerometers 30, 32 areliable measurement even in the case where the axis R is parallel tothe magnetic field B, and in the case of magnetic anomalies.

With reference to the embodiment of FIG. 8 , the simultaneousmeasurement made by the magnetometers 20, 22 and the gyroscopes 40, 42makes it possible, in addition to the advantages already listed withreference to FIG. 2 , to guarantee, via the gyroscopes 40, 42, areliable measurement even in the case where the axis R is parallel tothe magnetic field B. The gyroscopes 40, 42 moreover determine an amplebandwidth of the measurement of the lid angle α_(LID). In addition, thisembodiment enables reliable measurements both in the case where theportable device 10 is open like a book and, simultaneously, magneticanomalies are present and in the case where the portable device 10 isopen like a book and is simultaneously subjected to shaking (andtherefore to linear accelerations). The recursive use of formulae, in aclosed-loop system, moreover makes the system as a whole stable, rapid,and with a low computational load required. In fact, the gyroscopes 40,42 are not sensitive to high-frequency disturbance, as occurs, instead,for the accelerometers, or to magnetic disturbance, as occurs, instead,for the magnetometers; at the same time, the drawbacks associated to thecalculation of the lid angle α_(LID) performed only by means ofgyroscopes (storage of error and lack of knowledge of the initial lidangle upon switching-on of the portable device 10) are solved thanks tothe simultaneous measurement made by the magnetometers 20, 22.

Finally, it is clear that modifications and variations may be made tothe disclosure described and illustrated herein, without therebydeparting from the scope thereof.

In general, in the context of the present disclosure, the lid angleα_(LID) is the angle between two elements (even separate from oneanother, i.e., not having the hinge 15) or parts that concur in formingan electronic device or system for display of information (electronicapparatus). Such elements or parts are for example: a keypad and ascreen; a dual-screen device; a keypad and a tablet; a keypad and asmartphone; a smartphone and a tablet; two smartphones; two portions ofdisplay of a foldable smartphone; two tablets; or any other combinationof keypad, tablet, smartphone, and screen.

Furthermore, it should be noted that the magnetometers 20, 22, theaccelerometers 30, 32, and the gyroscopes 40, 42 may be implemented in:(i) modules separate from one another; (ii) 6-axes inertial-sensormodules (e.g., a first module integrating the first magnetometer 20 andthe first accelerometer 30, and a second module integrating the secondmagnetometer 22 and the second accelerometer 32); (iii) 9-axesinertial-sensor modules (a first module integrating the firstmagnetometer 20, the first accelerometer 30, and the first gyroscope 40,and a second module integrating the second magnetometer 22, the secondaccelerometer 32, and the second gyroscope 42). In this latter case, itis also possible to make a 9-axes measurement for guaranteeing anaccurate measurement of the lid angle α_(LID) in any condition of useand external factors of the portable device 10.

In some embodiments, a method for controlling at least one function ofan electronic apparatus (10) as a function of a value of a lid angle(α_(LID)) between a first hardware element (12; 14) and a secondhardware element (14; 12) of said electronic apparatus (10), wherein thefirst hardware element (12; 14) accommodates a first magnetometer (20;22) and the second hardware element (14; 12) accommodates a secondmagnetometer (22; 20) and is orientable with respect to the firsthardware element (12; 14), may be summarized as including the steps of:generating, by the first magnetometer (20) and by the secondmagnetometer (22), first signals (B₁, B₂) that are measurements of amagnetic field (B) external to the electronic apparatus (10) and areindicative of a relative orientation of the first hardware element withrespect to the second hardware element; acquiring, by a processing unit(27, 28) of the electronic apparatus (10), said first signals (B₁, B₂);generating, by the processing unit (27, 28) and as a function of thefirst signals (B₁, B₂), a calibration parameter (J1) indicative of acondition of calibration of the first and second magnetometers (20, 22);generating, by the processing unit (27, 28) and as a function of thefirst signals (B₁, B₂), a reliability value (K₁) indicative of acondition of reliability of the first signals (B₁, B₂); calculating(50), by the processing unit (27, 28), a first intermediate value(α_(LID) MAG) of said lid angle (α_(LID)) on the basis of the firstsignals (B₁, B₂); calculating (53), by the processing unit (27, 28), acurrent value of said lid angle (α_(LID)) on the basis of thecalibration parameter (J1), of the reliability value (K₁), and of saidfirst intermediate value (α_(LID) MAG) of the lid angle (α_(LID)); andcontrolling said function of the electronic apparatus (10) as a functionof the current value of the lid angle (α_(LID)).

In some embodiments, the first and second hardware elements (12, 14) arerotatable with respect to one another about a rotation axis (R), thefirst and second hardware elements (12, 14) have a respective firstsurface (12 a) and a respective second surface (14 a) directly faceableone another and defining between them the lid angle (αLID), and thefirst magnetometer (20) is a triaxial magnetometer having a respectivefirst sensing axis (x1), a respective second sensing axis (y1), and arespective third sensing axis (z1), and the second magnetometer (22) isa triaxial magnetometer having a respective first sensing axis (x2), arespective second sensing axis (y2), and a respective third sensing axis(z2), the first sensing axes (x1, x2) being parallel to the rotationaxis (R).

In some embodiments, the step of calculating the first intermediatevalue (αLID_MAG) includes executing the operation:

${{arc}\tan 2( \frac{{G{z_{2} \cdot {Gy}_{1}}} - {G{y_{2} \cdot {Gz}_{1}}}}{{G{z_{2} \cdot {Gz}_{1}}} + {G{y_{2} \cdot {Gy}_{1}}}} )} + \pi$

where Gy₁ is a component of the first signal (B₁) detected by the firstmagnetometer (20) along the respective second sensing axis (y₁), Gz₁ isa component of the first signal (B₁) detected by the first magnetometer(20) along the respective third sensing axis (z₁), Gy₂ is a component ofthe second signal (B₂) detected by the second magnetometer (22) alongthe respective second sensing axis (y₂), and Gz₂ is a component of thesecond signal (B₂) detected by the second magnetometer (22) along therespective third sensing axis (z₂).

In some embodiments, the step of generating the reliability value (K₁)includes: calculating a reliability angle (φ₁; φ_(a), φ_(b)) on thebasis of the first signals (B₁, B₂); and generating the reliabilityvalue (K₁) on the basis of a comparison between the reliability angle(φ₁; φ_(a), φ_(b)) and a threshold angle.

In some embodiments, the reliability angle (φ₁) is measured between therotation axis (R) and the magnetic field (B) external to the electronicapparatus (10), and wherein the step of calculating the reliabilityangle (φ₁) includes: calculating a first (φ_(a)) intermediate angle onthe basis of the first signal (B₁) of the first magnetometer (20) byexecuting the operation:

$\tan^{- 1}\frac{\sqrt{{Gy_{1}^{2}} + {Gz_{1}^{2}}}}{❘{Gx}_{1}❘}$

and/or calculating a second (φ_(b)) intermediate angle on the basis ofthe first signal (B₂) of the second magnetometer (22) by executing theoperation:

$\tan^{- 1}\frac{\sqrt{{Gy_{2}^{2}} + {Gz_{2}^{2}}}}{❘{Gx}_{2}❘}$

where Gx₁ is a component of the first signal (B₁) detected by the firstmagnetometer (20) along the respective first sensing axis (x₁), and Gx₂is a component of the second signal (B₂) detected by the secondmagnetometer (22) along the respective first sensing axis (x₂); andgenerating the reliability angle (φ₁) on the basis of the firstintermediate angle (φ_(a)) and/or of the second intermediate angle(φ_(b)), wherein: the reliability angle (φ₁) is equal to the first angle(φ_(a)); or the reliability angle (φ₁) is equal to the second angle(φ_(b)); or the reliability angle (φ₁) is equal to an average of the ofthe first and second angles (φ_(a), φ_(b)); or the reliability angle(φ₁) is equal to a weighted average of the first and second angles(φ_(a), φ_(b)).

In some embodiments, the step of generating the reliability value (K₁)includes:

calculating a first reliability angle (φ_(a)) on the basis of the firstsignals (B₁, B₂) by executing the operation:

$\tan^{- 1}\frac{\sqrt{{Gy_{1}^{2}} + {Gz_{1}^{2}}}}{❘{Gx}_{1}❘}$

where Gx₁ is a component of the first signal (B₁) detected by the firstmagnetometer (20) along the respective first sensing axis (x₁);calculating a second reliability angle (φ_(b)) on the basis of the firstsignals (B₁, B₂) by executing the operation:

$\tan^{- 1}\frac{\sqrt{{Gy_{2}^{2}} + {Gz_{2}^{2}}}}{❘{Gx}_{2}❘}$

where Gx₂ is a component of the second signal (B₂) detected by thesecond magnetometer (22) along the respective first sensing axis (x₂);and generating the reliability value (K₁) on the basis of a firstcomparison between the first reliability angle (φ_(a)) and a thresholdangle and on the basis of a second comparison between the secondreliability angle NO and said threshold angle.

In some embodiments, the step of generating the calibration parameter(J₁) includes: generating (49 a) calibrated data (D₂) on the basis ofthe first signals (B₁, B₂) through calibration parameters (P_(cal));comparing the calibrated data (D₂) with respective comparison data,generating a result of said comparison that indicates a need orotherwise to calibrate the first and second magnetometers (20, 22); andif the result of said comparison indicates the need to calibrate thefirst and second magnetometers, executing the steps of: calibrating (49c) the first and second magnetometers (20, 22) to generate newcalibration parameters (P_(cal)), assigning (49 d) to the calibrationparameter (J₁) a first value indicating execution of the calibration ofthe first and second magnetometers (20, 22), and replacing (49 c) saidcalibration parameters (P_(cal)) with the new calibration parameters(P_(cal)) generated by calibrating the first and second magnetometers(20, 22).

In some embodiments, the step of generating (49) the calibrationparameter (J₁) further includes: if the result of said comparison doesnot indicate the need to calibrate the first and second magnetometers,executing the steps of: determining (49 e), on the basis of thecalibrated data (D₂), whether a condition of magnetic interference hasbeen verified at the first and second magnetometers (20, 22); and in theabsence of said magnetic interference, assigning (49 d) to thecalibration parameter (J₁) said first value; or in the presence of saidmagnetic interference, assigning (490 to the calibration parameter (J₁)a second value different from the first value.

In some embodiments, the reliability value (K₁) is a function of thecalibration parameter (J₁), wherein the step of calculating (53) thecurrent value of said lid angle (α_(LID)) comprises recursively updatingsaid current value of the lid angle (α_(LID)) by executing theoperation:

α_(LID)(t)=(1−K ₁′)·α_(LID)(t−1)+K ₁′·α_(LID_MAG)(t)

with K₁′=n·K₁, where K₁ is the reliability value and has a value equalto or greater than 0 and smaller than or equal to 1, n is a coefficientwith a value greater than 0 and smaller than or equal to 1, α_(LID)(t)is the current value of the lid angle (α_(LID)), α_(LID)(t−1) is a valueof the lid angle (α_(LID)) at an instant immediately preceding theinstant of the current value α_(LID)(t), and α_(LID_MAG)(t) is the firstintermediate value.

In some embodiments, the first hardware element (12; 14) furtheraccommodates a first accelerometer (30; 32), and the second hardwareelement (14; 12) further accommodates a second accelerometer (32; 30),the control method further comprising the steps of: acquiring, by theprocessing unit (27, 28) through the first and second accelerometers(30, 32), second signals indicative of measurements of relativeorientation of the first and second hardware elements; calculating (55),by the processing unit (27, 28), a second intermediate value(α_(LID_ACC)) of said lid angle (α_(LID)) on the basis of the secondsignals; and calculating (56), by the processing unit (27, 28), saidcurrent value of the lid angle (α_(LID)) further on the basis of saidsecond intermediate value (α_(LID_ACC)) of the lid angle (α_(LID)).

In some embodiments, the method further includes the step of generating(54), by the processing unit (27, 28) and as a function of the secondsignals, a further reliability value (K₂) indicative of a condition ofreliability of the second signals.

In some embodiments, the step of calculating (56) the current value ofthe lid angle (α_(LID)) includes executing the operation:

K _(LP)·α_(LID_ACC_MAG)(t)+(1−K _(LP))·α_(LID)(t−1)

where α_(LID)(t−1) is a value of the angle at an instant immediatelypreceding the instant of the current value, K_(LP) is a coefficientgreater than or equal to 0 and smaller than or equal to 1, andα_(LID_ACC_MAG)(t) is a value equal to: the second intermediate value(α_(LID_ACC)), if the reliability value (K₁) is equal to 0 and thefurther reliability value (K₂) is other than 0; or the firstintermediate value (α_(LID) MAG), if the reliability value (K₁) is otherthan 0 and the further reliability value (K₂) is equal to 0; or(K₁·α_(LID_MAG)(t)+K₂·α_(LID_ACC)(t))/(K₁+K₂) if the reliability value(K₁) is other than 0 and the further reliability value (K₂) is otherthan 0, where α_(LID_MAG)(t) is the first intermediate value, andα_(LID_ACC)(t) is the second intermediate value, K₁ is the reliabilityvalue and K₂ is the further reliability value, and where K_(LP) is equalto 0 if the reliability value (K₁) is equal to 0 and the furtherreliability value (K₂) is equal to 0.

In some embodiments, the first hardware element (12; 14) furtheraccommodates a first gyroscope (40; 42) and the second hardware element(14; 12) further accommodates a second gyroscope (42; 40), the methodfurther comprising the steps of: acquiring, by the processing unit (27,28) and through the first and second gyroscopes (40, 42), second signalsindicative of measurements of relative orientation of the first andsecond hardware elements; calculating (58), by the processing unit (27,28), a second intermediate value (α_(LID_GYR)) of said lid angle(α_(LID)) on the basis of the second signals; and calculating (60), bythe processing unit (27, 28), said current value of the lid angle(α_(LID)) further on the basis of said second intermediate value(α_(LID_GYR)) of the lid angle (α_(LID)).

In some embodiments, the step of calculating the current value of thelid angle (α_(LID)) includes the step of executing a weighted sum of thefirst intermediate value (α_(LID_MAG)) and of the second intermediatevalue (α_(LID_GYR)).

In some embodiments, the step of executing the weighted sum includesexecuting the operation:

α_(LID)(t)=K ₁′·α_(LID_MAG)(t)+(1−K ₁′)·α_(LID_GYR)(t)

with K₁=n·K₁, where K₁ is the reliability value and has a value equal toor greater than 0 and smaller than or equal to 1, n is a coefficientwith a value greater than 0 and smaller than or equal to 1, α_(LID)(t)is the current value of the angle, α_(LID_MAG)(t) is the firstintermediate value, and α_(LID_GYR)(t) is the second intermediate value.

In some embodiments, an electronic apparatus (10) may be summarized asincluding: a first hardware element (12; 14) accommodating a firstmagnetometer (20; 22); and a second hardware element (14; 12)accommodating a second magnetometer (22; 20), orientable with respect tothe first hardware element (12), and defining a lid angle (α_(LID)) withsaid first hardware element (12; 14). The first and second magnetometers(20, 22) are configured for generating first signals (B₁, B₂) that aremeasurements of a magnetic field (B) external to the electronicapparatus (10) and are indicative of a relative orientation of the firsthardware element with respect to the second hardware element. Theelectronic apparatus (10) further includes a processing unit (27, 28)configured for executing the operations of: acquiring said first signals(B₁, B₂); generating, as a function of the first signals (B₁, B₂), acalibration parameter (J₁) indicative of a condition of calibration ofthe first and second magnetometers (20, 22); generating, as a functionof the first signals (B₁, B₂), a reliability value (K₁) indicative of acondition of reliability of the first signals (B₁, B₂); calculating (50)a first intermediate value (α_(LID_MAG)) of said lid angle (α_(LID)) onthe basis of the first signals (B₁, B₂); calculating (53) a currentvalue of said lid angle (α_(LID)) on the basis of the calibrationparameter (J₁), of the reliability value (K₁), and of said firstintermediate value (α_(LID) MAG) of the lid angle (α_(LID)); andcontrolling said function of the electronic apparatus (10) as a functionof the current value of the lid angle (α_(LID)).

In some embodiments, the first magnetometer (20) is a triaxialmagnetometer having a respective first sensing axis (x₁), a respectivesecond sensing axis (y₁), and a respective third sensing axis (z₁)sensing axis, and the second magnetometer (22) is a triaxialmagnetometer having a respective first sensing axis (x₂), a respectivesecond sensing axis (y₂), and a respective third sensing axis (z₂), thefirst sensing axes (x₁, x₂) being parallel to one another, and when saidmagnetic field (B) acts in a direction parallel to a rotation axis (R)about which the first and second hardware elements (12, 14) arerotatable with respect to one another, only the first sensing axes (x₁,x₂) are subject to the magnetic field (B), and the processing unit (27,28) is configured for assigning to the reliability value (K₁) apredefined value indicative of unreliability of the first signals (B₁,B₂).

In some embodiments, the first hardware element (12; 14) furtheraccommodates a first accelerometer (30; 32), the second hardware element(14; 12) further accommodates a second accelerometer (32; 30), and theprocessing unit (27, 28) is further configured for executing theoperations of: acquiring, through the first and second accelerometers(30, 32), second signals indicative of measurements of relativeorientation of the first and second hardware elements; calculating (55)a second intermediate value (α_(LID_ACC)) of said lid angle (α_(LID)) onthe basis of the second signals; and calculating (56) said current valueof the lid angle (α_(LID)) further on the basis of said secondintermediate value (α_(LID_ACC)) of the lid angle (α_(LID)).

In some embodiments, the first hardware element (12; 14) furtheraccommodates a first gyroscope (40; 42), and the second hardware element(14; 12) further accommodates a second gyroscope (42; 40); and theprocessing unit (27, 28) is further configured for executing theoperations of: acquiring, through the first and second gyroscopes (40,42), second signals indicative of measurements of relative orientationof the first and second hardware elements; calculating (58) a secondintermediate value (α_(LID_GYR)) of said lid angle (α_(LID)) on thebasis of the second signals; and calculating (60) said current value ofthe lid angle (α_(LID)) on the basis of said second intermediate value(α_(LID_GYR)) of the lid angle (α_(LID)).

In some embodiments, the first hardware element (12) is provided with afirst user-interaction device (18) and the second hardware element (14)is provided with a second user-interaction device (16), and theoperation of controlling said function of the electronic apparatus (10)comprises adapting operative features or operation features of the firstinteraction device (18) and/or of the second interaction device (16) asa function of the current value of the lid angle (α_(LID)).

In some embodiments, a software product is provided in which thesoftware product is to be loaded into a processing unit (27, 28) of anelectronic apparatus (10) comprising a first hardware element (12; 14)accommodating a first magnetometer (20; 22), and a second hardwareelement (14; 12) accommodating a second magnetometer (22; 20),orientable with respect to the first hardware element (12), and defininga lid angle (α_(LID)) with said first hardware element (12; 14); whereinthe first and second magnetometers (20, 22) are configured forgenerating first signals (B₁, B₂) that are measurements of a magneticfield (B) external to the electronic apparatus (10) and are indicativeof a relative orientation of the first hardware element with respect tothe second hardware element, said software product being designed insuch a way that, when it is run, the processing unit (27, 28) becomesconfigured for: acquiring said first signals (B₁, B₂); generating, as afunction of the first signals (B₁, B₂), a calibration parameter (J₁)indicative of a condition of calibration of the first and secondmagnetometers (20, 22); generating, as a function of the first signals(B₁, B₂), a reliability value (K₁) indicative of a condition ofreliability of the first signals (B₁, B₂); calculating (50) a firstintermediate value (α_(LID_MAG)) of said lid angle (α_(LID)) on thebasis of the first signals (B₁, B₂); calculating (53) a current value ofsaid lid angle (α_(LID)) on the basis of the calibration parameter (J₁),of the reliability value (K₁), and of said first intermediate value(α_(LID_MAG)) of the lid angle (α_(LID)); and controlling said functionof the electronic apparatus (10) as a function of the current value ofthe lid angle (α_(LID)).

The various embodiments described above can be combined to providefurther embodiments. All of the U.S. patents, U.S. patent applicationpublications, U.S. patent applications, foreign patents, foreign patentapplications and non-patent publications referred to in thisspecification and/or listed in the Application Data Sheet areincorporated herein by reference, in their entirety. Aspects of theembodiments can be modified, if necessary to employ concepts of thevarious patents, applications and publications to provide yet furtherembodiments.

These and other changes can be made to the embodiments in light of theabove-detailed description. In general, in the following claims, theterms used should not be construed to limit the claims to the specificembodiments disclosed in the specification and the claims, but should beconstrued to include all possible embodiments along with the full scopeof equivalents to which such claims are entitled. Accordingly, theclaims are not limited by the disclosure.

1. A method, comprising: generating, by a first magnetometer and asecond magnetometer of an electronic apparatus, first signals indicatingmeasurements of a magnetic field, the first magnetometer and the secondmagnetometer being in a first hardware element and a second hardwareelement, respectively, of the electronic apparatus; determining, by aprocessing unit of the electronic apparatus, a calibration parameterbased on the first signals, the calibration parameter indicating acondition of calibration of the first and second magnetometers;determining, by the processing unit, a reliability value based on thefirst signals, the reliability value indicating of a condition ofreliability of the first signals; determining, by the processing unit, afirst value of a lid angle between the first hardware element and thesecond hardware element based on the first signals; determining, by theprocessing unit, a second value of the lid angle based on thecalibration parameter, the reliability value, and the first value of thelid angle; and controlling, by the processing unit, a function of theelectronic apparatus based on the second value of the lid angle.
 2. Themethod according to claim 1, wherein the first and second hardwareelements are rotatable around a rotation axis, and the lid angle isbetween a surface of the first hardware element and a surface of thesecond hardware element.
 3. The method according to claim 2, wherein thedetermining of the first value includes executing the operation:${{arc}\tan 2( \frac{{G{z_{2} \cdot {Gy}_{1}}} - {G{y_{2} \cdot {Gz}_{1}}}}{{G{z_{2} \cdot {Gz}_{1}}} + {G{y_{2} \cdot {Gy}_{1}}}} )} + \pi$where Gy₁ is a component of the first signal generated by the firstmagnetometer along a first sensing axis of the first magnetometer, Gz₁is a component of the first signal generated by the first magnetometeralong a second sensing axis of the first magnetometer, Gy₂ is acomponent of the first signal generated by the second magnetometer alonga first sensing axis of the second magnetometer, and Gz₂ is a componentof the first signal generated by the second magnetometer along a secondsensing axis of the second magnetometer.
 4. The method according toclaim 3, wherein the determining of the reliability value includes:determining a reliability angle based on the first signals; anddetermining the reliability value based on a comparison between thereliability angle and a threshold angle.
 5. The method according toclaim 4, wherein the reliability angle is measured between the rotationaxis and the magnetic field, and the determining of the reliabilityangle includes: determining a first intermediate angle based on thefirst signal of the first magnetometer by executing the operation:$\tan^{- 1}\frac{\sqrt{{Gy_{1}^{2}} + {Gz_{1}^{2}}}}{❘{Gx}_{1}❘}$ ordetermining a second intermediate angle based on the first signal of thesecond magnetometer by executing the operation:$\tan^{- 1}\frac{\sqrt{{Gy_{2}^{2}} + {Gz_{2}^{2}}}}{❘{Gx}_{2}❘}$ whereGx₁ is a component of the first signal generated by the firstmagnetometer along a third sensing axis of the first magnetometer, andGx₂ is a component of the first signal generated by the secondmagnetometer along a third sensing axis of the second magnetometer; anddetermining the reliability angle based on the first intermediate angleor the second intermediate angle.
 6. The method according to claim 3,wherein the determining the reliability value includes: determining afirst reliability angle based on the first signals by executing theoperation:$\tan^{- 1}\frac{\sqrt{{Gy_{1}^{2}} + {Gz_{1}^{2}}}}{❘{Gx}_{1}❘}$ whereGx₁ is a component of the first signal generated by the firstmagnetometer along a third sensing axis of the first magnetometer;determining a second reliability angle based on the first signals byexecuting the operation:$\tan^{- 1}\frac{\sqrt{{Gy_{2}^{2}} + {Gz_{2}^{2}}}}{❘{Gx}_{2}❘}$ whereGx₂ is a component of the first signal generated by the secondmagnetometer along a third sensing axis of the second magnetometer; anddetermining the reliability value based on a first comparison betweenthe first reliability angle and a threshold angle and based on a secondcomparison between the second reliability angle and the threshold angle.7. The method according to claim 1, wherein the determining of thecalibration parameter includes: determining calibrated data based on thefirst signals; and comparing the calibrated data with respectivecomparison data.
 8. The method according to claim 1, wherein thereliability value is a function of the calibration parameter, thedetermining of the second value of the lid angle includes recursivelyupdating the second value of the lid angle by executing the operation:α_(LID)(t)=(1−K ₁′)·α_(LID)(t−1)+K ₁′·α_(LID_MAG)(t) with K₁=n K₁, whereK₁ is the reliability value and has a value equal to or greater than 0and smaller than or equal to 1, n is a coefficient with a value greaterthan 0 and smaller than or equal to 1, α_(LID)(t) is the second value ofthe lid angle, α_(LID)(t−1) is a value of the lid angle at an instantimmediately preceding the instant of the second value α_(LID)(t), andα_(LID_MAG)(t) is the first value.
 9. The method according to claim 1,wherein the first hardware element includes a first accelerometer, thesecond hardware element includes a second accelerometer, and the methodfurther includes: generating, by the first accelerometer and the secondaccelerometer, second signals indicating measurements of relativeorientation of the first and second hardware elements; determining, bythe processing unit, a third value of the lid angle based on the secondsignals; and determining, by the processing unit, the second value ofthe lid angle based on the third value of the lid angle.
 10. The methodaccording to claim 9, further comprising: determining, by the processingunit, another reliability value based on the second signals, the anotherreliability value indicating a condition of reliability of the secondsignals.
 11. The method according to claim 10, wherein the determiningof the second value of the lid angle includes executing the operation:K _(LP)·α_(LID_ACC_MAG)(t)+(1−K _(LP))·α_(LID)(t−1) where α_(LID)(t−1)is a value of the lid angle at an instant immediately preceding theinstant of the second value, K_(LP) is a coefficient greater than orequal to 0 and smaller than or equal to 1, and α_(LID_ACC_MAG)(t) is avalue equal to: the third value in a case where the reliability value isequal to 0 and the another reliability value is not equal to 0; or thefirst value in a case where the reliability value is not equal to 0 andthe another reliability value is equal to 0; or(K₁·α_(LID_MAG)(t)+K₂·α_(LID_ACC)(t))/(K₁+K₂) in a case where thereliability value is not equal to 0 and the another reliability value isnot equal to 0, where α_(LID_MAG)(t) is the first value, andα_(LID_ACC)(t) is the third value, K₁ is the reliability value and K₂ isthe another reliability value, and where K_(LP) is equal to 0 if thereliability value is equal to 0 and the another reliability value isequal to
 0. 12. The method according to claim 1, wherein the firsthardware element includes a first gyroscope, the second hardware elementincludes a second gyroscope, and the method further includes:generating, by the first gyroscope and second gyroscope, second signalsindicating measurements of relative orientation of the first and secondhardware elements; determining, by the processing unit, a third value ofthe lid angle based on the second signals; and determining, by theprocessing unit, the second value of the lid angle based on the thirdvalue of the lid angle.
 13. The method according to claim 12, whereinthe determining of the second value of the lid angle includes executinga weighted sum of the first value and of the third value.
 14. The methodaccording to claim 13, wherein the executing of the weighted sumincludes executing the operation:α_(LID)(t)=K ₁′·α_(LID_MAG)(t)+(1−K ₁′)·α_(LID_GYR)(t) with K₁=n K₁,where K₁ is the reliability value and has a value equal to or greaterthan 0 and smaller than or equal to 1, n is a coefficient with a valuegreater than 0 and smaller than or equal to 1, α_(LID)(t) is the secondvalue of the angle, α_(LID_MAG)(t) is the first value, andα_(LID_GYR)(t) is the third value.
 15. A device, comprising: a firsthardware element including a first magnetometer; a second hardwareelement including a second magnetometer, the first magnetometer and thesecond magnetometer configured to generate first signals indicatingmeasurements of a magnetic field; and a processing unit configured to:determine a calibration parameter based on the first signals, thecalibration parameter indicating a condition of calibration of the firstand second magnetometers; determine a reliability value based on thefirst signals, the reliability value indicating of a condition ofreliability of the first signals; determine a first value of a lid anglebetween the first hardware element and the second hardware element basedon the first signals; determine a second value of the lid angle based onthe calibration parameter, the reliability value, and the first value ofthe lid angle; and control a function of the device based on the secondvalue of the lid angle.
 16. The device according to claim 15, whereinthe first and second hardware elements are rotatable around a rotationaxis, and the lid angle is between a surface of the first hardwareelement and a surface of the second hardware element.
 17. The deviceaccording to claim 15, wherein the first hardware element includes afirst accelerometer, the second hardware element includes a secondaccelerometer, the first accelerometer and the second accelerometer areconfigured to generate second signals indicating measurements ofrelative orientation of the first and second hardware elements theprocessing unit is configured to: determine a third value of the lidangle based on the second signals; and determine the second value of thelid angle based on the third value of the lid angle.
 18. The deviceaccording to claim 15, wherein the first hardware element includes afirst gyroscope, the second hardware element includes a secondgyroscope, the first gyroscope and second gyroscope are configured togenerate second signals indicating measurements of relative orientationof the first and second hardware elements; the processing unit isconfigured to: determine a third value of the lid angle based on thesecond signals; and determine the second value of the lid angle based onthe third value of the lid angle.
 19. A non-transitory computer-readablemedium having contents which configure a processing unit of anelectronic apparatus to perform a method, the method comprising:receiving, from a first magnetometer and a second magnetometer of theelectronic apparatus, first signals indicating measurements of amagnetic field, the first magnetometer and the second magnetometer beingin a first hardware element and a second hardware element, respectively,of the electronic apparatus; determining a calibration parameter basedon the first signals, the calibration parameter indicating a conditionof calibration of the first and second magnetometers; determining areliability value based on the first signals, the reliability valueindicating of a condition of reliability of the first signals;determining a first value of a lid angle between the first hardwareelement and the second hardware element based on the first signals;determining a second value of the lid angle based on the calibrationparameter, the reliability value, and the first value of the lid angle;and controlling a function of the electronic apparatus based on thesecond value of the lid angle.
 20. The non-transitory computer-readablemedium according to claim 19, wherein the first and second hardwareelements are rotatable around a rotation axis, and the lid angle isbetween a surface of the first hardware element and a surface of thesecond hardware element.